package com.alarmclocksnoozers.runnershigh;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Toast;

public class Info extends Activity{
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
		
        super.onCreate(savedInstanceState);
        setContentView(R.layout.info);

        Toast.makeText(getApplicationContext(), "names and logos are clickable", Toast.LENGTH_LONG).show();
    }
    
    public void visitWebsite(View view) {
    	Intent browserIntent = null;

        int id = view.getId();
        if (id == R.id.buttonRunnersHigh) {
            browserIntent = new Intent("android.intent.action.VIEW", Uri.parse(Settings.URL_RUNNERSHIGH));
        } else if (id == R.id.buttonAndre) {
            browserIntent = new Intent("android.intent.action.VIEW", Uri.parse(Settings.URL_ANDRE));
        } else if (id == R.id.buttonAndreas) {
            browserIntent = new Intent("android.intent.action.VIEW", Uri.parse(Settings.URL_ANDREAS));
        } else if (id == R.id.buttonChris) {
            browserIntent = new Intent("android.intent.action.VIEW", Uri.parse(Settings.URL_CHRIS));
        } else if (id == R.id.buttonFrancois) {
            browserIntent = new Intent("android.intent.action.VIEW", Uri.parse(Settings.URL_FRANCOIS));
        } else if (id == R.id.buttonHans) {
            browserIntent = new Intent("android.intent.action.VIEW", Uri.parse(Settings.URL_HANS));
        } else if (id == R.id.buttonManuel) {
            browserIntent = new Intent("android.intent.action.VIEW", Uri.parse(Settings.URL_MANUEL));
        } else if (id == R.id.buttonWebi) {
            browserIntent = new Intent("android.intent.action.VIEW", Uri.parse(Settings.URL_WEBI));
        } else if (id == R.id.buttonFHS) {
            browserIntent = new Intent("android.intent.action.VIEW", Uri.parse(Settings.URL_FH));
        } else if (id == R.id.buttonMMT) {
            browserIntent = new Intent("android.intent.action.VIEW", Uri.parse(Settings.URL_MMT));
        } else if (id == R.id.buttonMMA) {
            browserIntent = new Intent("android.intent.action.VIEW", Uri.parse(Settings.URL_MMA));
        } else {
            Log.e("RunnersHigh", "unexpected buttonclick");
        }
    	
    	if (browserIntent != null) startActivity(browserIntent);
    }
}
